<template>
	<view class=".flex-container">
		<view class=".flex-items">
			<view class=".flex-items1_column">
				<!-- <button size="default" open-type="chooseAvatar" class=".flex-items1_column_touxiang" @chooseavatar="chooseAvatar"> -->
				<button size="default" class=".flex-items1_column_touxiang">
					<image style="width: 150rpx;height: 150rpx;border-radius: 50%;" :src="userAvatar"></image>
				</button>
				<view class=".flex-items1_column_nicheng">古董先生</view>
			</view>
			<view class=".flex-items1_column2">
				<view class=".flex-items1_column2_jifen">
					<view>会员积分:1000</view>
					<view>
						手机:150****9880
					</view>
				</view>
				<view class=".flex-items1_column2_chongzhi"><button size="mini"></button></view>
			</view>

		</view>
		<view class=".flex-items">
			
		</view>
		<view class=".flex-items">
			<u-cell-group>
					<u-cell @click="myOrders()" icon="setting-fill" url="/pages/orders/orders" title="我的订单" isLink></u-cell>
					<u-cell @click="calling()" icon="integral-fill" title="客服电话" isLink></u-cell>
					<u-cell @click="logout()" icon="integral-fill" title="退出登录" isLink></u-cell>
				</u-cell-group>
			
			
<!-- 			<view class=".flex-container_3">
				<view class=".flex-items3">
					<navigator url="/pages/orders/orders" animation-type="slide-in-right" animation-duration="300"
						hover-class="navigator-hover">
						<view class=".flex-items3_icon">
							<uni-icons type="star" size="40"></uni-icons>
								<text>我的订单</text>
						</view>
					</navigator>
				</view>
				<view class=".flex-items3" @click="login">
					<view class=".flex-items3_icon">
						<uni-icons type="map-pin" size="40"></uni-icons>
						<text>押金</text>
					</view>
				</view>				 
				<view class=".flex-items3" @click="wxPay">
					<view class=".flex-items3_icon">
						<uni-icons type="folder-add" size="40"></uni-icons>
						<text>优惠券</text>
					</view>
				</view>
				<view class=".flex-items3">
					<button class=".contact_button .flex-items3_icon" open-type="contact" >
						<uni-icons  type="headphones" size="40"></uni-icons>
						<text >客服</text>
					</button>
				</view>
				<view class=".flex-items3" @click="heZuo">
					<view class=".flex-items3_icon">
						<uni-icons type="loop" size="40"></uni-icons>
						<text>合作共赢</text>
					</view>
				</view>
				<view class=".flex-items3">
					<view class=".flex-items3_icon">
						<uni-icons type="search" size="40"></uni-icons>
						<text>帮助</text>
					</view>
				</view>
			</view> -->
		</view>
		<!-- 登陆组件 -->
		<com-login ref="login"></com-login>
	</view>

</template>

<script>
	import UniIcons from "../../uni_modules/uni-icons/components/uni-icons/uni-icons.vue";

	export default {
		components: {
			UniIcons
		},
		data() {
			return {
				userAvatar:'../../static/logo/logo.png'
			}
		},
		onLoad() {

		},
		methods: {
			login() {
				this.$refs.login.openLogin()
			},
			logout(){
				uni.navigateTo({
				  url: '/pages/login/login'
				})
			},
			myOrders(){
				
			},
			calling: function () {
				let phoneNumber = '15093359880';
			  console.log('==phoneNumber===',phoneNumber)
			  uni.makePhoneCall({
			    phoneNumber: phoneNumber,
			    success: function () {
			      console.log("拨打电话成功！")
			    },
			    fail: function () {
			      console.log("拨打电话失败！")
			    }
			  })
			},
			chooseAvatar(e){
				console.log("chooseAvatar:",e)
				// this.userAvatar = e.detail.avatarUrl;
				
				// AvatarUrl
			},
			heZuo(){
				uni.navigateTo({
					url:"/pages/webview/webview"
				})
			},
			wxPay(){
				uni.requestPayment({
				    provider: 'wxpay',
					timeStamp: String(Date.now()),
					nonceStr: 'A1B2C3D4E5',
					package: 'prepay_id=wx20180101abcdefg',
					signType: 'MD5',
					paySign: '',
					success: function (res) {
						console.log('success:' + JSON.stringify(res));
					},
					fail: function (err) {
						console.log('fail:' + JSON.stringify(err));
					}
				});
			},
			onChooseAvatar(res) {
				console.log(res)
				const {
					detail
				} = res
				this.cdnUrl = detail.avatarUrl
			},

		}
	}
</script>

<style>
@import "./index.css";
</style>